<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        html,body{
            height: 100%;
            width: 100%;
        }
        .light{
            background-color: white;
            color: black;
            height: 100%;
            width: 100%;
        }
        .dark{
            background-color: black;
            color: white;
            height: 100%;
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="light">
        <div>hello world</div>
        <div>hello world</div>
        <div>hello world</div>
    </div>
    <script>
        let elm=document.querySelector('.light')
        elm.onclick=function(){
            if(elm.className=='light')
                elm.className='dark'
            else
                elm.className='light'
        }
    </script>
</body>
</html>